import urllib
from urllib import request
import ssl

# 2. 表示忽略未经核实的SSL证书认证
context = ssl._create_unverified_context();

url = "https://www.12306.cn/mormhweb/"
headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36"}

re = request.Request(url, headers = headers);
response = request.urlopen(re,context=context);
buff = response.read();
html = buff.decode("utf8");
print(html);
